<nav class="navbar navbar-expand-lg navbar-light bg-light fixed-top">
  <div class="container-fluid">
    <a class="navbar-brand" href="/">
      <!-- 插入logo -->
      <%= image_tag 'logo.png', alt: 'Logo', style: 'width: 50px; margin-left: 20px;'%>
    </a>
    <button class="navbar-toggler" type="button" data-bs-toggle="collapse" data-bs-target="#navbarNav" aria-controls="navbarNav" aria-expanded="false" aria-label="Toggle navigation">
      <span class="navbar-toggler-icon"></span>
    </button>
    <div class="collapse navbar-collapse" id="navbarNav">
      <ul class="navbar-nav me-auto mb-2 mb-md-0">
        <li class="nav-item">
          <a class="nav-link <%= request.path == '/' ? 'link-primary' : '' %>" aria-current="page" href="/">首页</a>
        </li>
        <li class="nav-item">
          <a class="nav-link <%= request.path == '/members' ? 'link-primary' : '' %>" href="/members">团队</a>
        </li>
        <li class="nav-item">
          <a class="nav-link <%= request.path == '/projects' ? 'link-primary' : '' %>" href="/projects">项目</a>
        </li>
        <li class="nav-item">
          <a class="nav-link <%= request.path == '/cmps' ? 'link-primary' : '' %>" href="/cmps">组件</a>
        </li>
        <li class="nav-item">
          <a class="nav-link <%= request.path == '/tools' ? 'link-primary' : '' %>" href="/tools">工具</a>
        </li>
        <li class="nav-item">
          <a class="nav-link <%= request.path == '/questions' ? 'link-primary' : '' %>" href="/questions">常见问题</a>
        </li>
        <li class="nav-item">
          <a class="nav-link <%= request.path == '/feedbacks' ? 'link-primary' : '' %>" href="/feedbacks">反馈</a>
        </li>
      </ul>
      <form class="d-flex mx-sm-2">
        <input class="form-control me-2" type="search" placeholder="请输入查询内容" aria-label="Search">
        <button type="button" class="btn btn-primary">
          <i class="bi-search"></i>
        </button>
      </form>
      <div class="d-flex">
        <% if logged_in? %>
          <%= link_to "#{current_user.username}, 退出", "/logout" %>
        <% else %>
          <a class="btn btn-secondary me-2" href="/login">
            <i class="bi-arrow-down-circle"></i>登录
          </a>
          <a class="btn btn-primary" href="/register">
            <i class="bi-person-plus"></i>注册
          </a>
        <% end %>

      </div>

    </div>
  </div>
</nav>
